#ifndef __FRAME_H__
#define __FRAME_H__

#include "stdfx.h"

#define PINS_COUNT 10

class Turn;
class PinScheme;
class FrameBonus;
class FrameBehaviour;

class Frame : private boost::noncopyable
{
public:

    enum class Bonus
    {
        NONE,
        STRIKE,
        SPARE,
        SPLIT
    };

    Frame(std::shared_ptr<FrameBehaviour> frameBehaviour);
    Frame();
    
    ~Frame();

    
//    Frame(const Frame& other) = delete;
//    Frame(Frame&&)            = default;
    
    bool isOpened() const;
    void close();
    
    void finish();
    bool isDone() const;
    
    int getPinsLeft() const;
    int getScores() const;
    int getThrowCount() const;
    
    void addScores(int scores);
    Frame::Bonus fire(const PinScheme& scheme);//(Turn& turn);
    void castSpecials();
    
private:
    

    int     _scores;
    int     _throwCount;
    int     _pinsLeft;
    bool    _isOpened;
    bool    _isDone;
    
    std::shared_ptr<FrameBehaviour> _frameBehaviour;
    
    std::vector<Bonus>      _bonuses;   //  TODO: rename type and variable
    
    std::vector<std::unique_ptr<FrameBonus>> _specials;

    std::vector<PinScheme>  _turns;
    
};

class MultiplayFrame : public Frame
{
    ~MultiplayFrame()
    {
    }
};

#endif